﻿using System.Collections.Generic;
using Hopscotch.Common.Contracts.EnqService;
using Hopscotch.Domain.Finance;
using Hopscotch.Server.Common.Contracts;
using Microsoft.AspNet.SignalR.Hubs;

namespace Hopscotch.Server.EnqSignalRHost.Hubs
{
    [HubName(HubNames.InstrumentEnqHub)]
    public class InstrumentEnqHub : HubBase
    {
        private readonly IInternalInstrumentEnqService instrumentService;

        public InstrumentEnqHub(IInternalInstrumentEnqService instrumentService)            
        {
            this.instrumentService = instrumentService;
        }
        
        public Instrument GetInstrument(int id)
        {
            return instrumentService.Get(id);
        }        
        
        public ICollection<Instrument> SearchInstrument(string search)
        {
            return instrumentService.Search(search);
        }
    }
}
